{
 "cells": [
  {
   "cell_type": "markdown",
   "source": [
    "Pip install is the command you use to install Python packages with the help of a tool called Pip package manager.\n",
    "Installing LangChain package"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "b7973e7e4c6ff584"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "!pip install langChain"
   ],
   "metadata": {
    "collapsed": false,
    "is_executing": true
   },
   "id": "2ca7e331fbe4f684"
  },
  {
   "cell_type": "markdown",
   "source": [
    "# Let's use Proprietary LLM from-OpenAl\n",
    "\n",
    "Installing Openai package,which includes the classes that we can use to communicate with Openai services"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "e562a58352735cc7"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "!pip install Openai"
   ],
   "metadata": {
    "collapsed": false,
    "is_executing": true
   },
   "id": "80b949176092976"
  },
  {
   "cell_type": "markdown",
   "source": [
    "Imports the Python built-in module called \"os.\"\n",
    "This module provides a way to interact with the operating system,such as accessing environment variables,working with files and directories,executing shell\n",
    "commands,etc\n",
    "The environ attribute is a dictionary-like object that contains the environment variables of the current operating system session\n",
    "By accessing os.environ,you can retrieve and manipulate environment variables within your Python program.For example,you can retrieve the value of a\n",
    "specific environment variable using the syntax os.environ[\"VARIABLE_NAME],where \"VARIABLE_NAME\"is the name of the environment variable you want to\n",
    "access."
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "63c31cefc0d19b03"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "import os\n",
    "os.environ[\"OPENAI_API_KEY\"]='sk-Qg2sQRe2BTRDkjXCAaCa243017994a8aBf2e5bC26aE8Af99'"
   ],
   "metadata": {
    "collapsed": false,
    "is_executing": true
   },
   "id": "f17dcdc7053149fe"
  },
  {
   "cell_type": "markdown",
   "source": [
    "LangChain has built a Wrapper around OpenAl APIs,using which we can get access to all the services OpenAl provides.\n",
    "The code snippet below imports a specific class called 'OpenAl'(Wrapper around OpenAl large language models)from the 'llms'module of the 'langchain'\n",
    "library.\n",
    "https://python.langchain.com/en/latest/modules/langchain/llms/openai.html"
   ],
   "metadata": {
    "collapsed": false
   },
   "id": "b94333672e847d4f"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [
    "from langChain.llms import OpenAI"
   ],
   "metadata": {
    "collapsed": false,
    "is_executing": true
   },
   "id": "bc66ce8386cd287b"
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "outputs": [],
   "source": [],
   "metadata": {
    "collapsed": false
   },
   "id": "617193d4f4604483"
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
